#!/bin/sh

# 删除，删除后需要调用cluster forget
#redis-trib.rb del-node 127.0.0.1:7000 <node-id>
#CLUSTER FORGET <node-id>
#
## 添加一个从节点
#redis-trib.rb add-node --slave 127.0.0.1:7006 127.0.0.1:7000
## 明确指明master-id
#redis-trib.rb add-node --slave --master-id 3c3a0c74aae0b56170ccb03a76b60cfe7dc1912e 127.0.0.1:7006 127.0.0.1:7000

# 添加新的主节点
src=7006
rm ${src}/*
cp conf/redis-${src}.conf ${src}
cd ${src}
redis-server ./redis-${src}.conf&
cd -

redis-trib.rb add-node 127.0.0.1:7006 127.0.0.1:7000


